<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('')" />
</head>
<body class="white-bg">
	<div class="row">
		<div class="col-md-6">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<h5>告警信息</h5>
				</div>
				<div class="ibox-content">
					<div class="table-responsive">
						<table class="table table-bordered table-striped">
							<thead>
								<tr>
									<th>衡器：</th>
									<th><span th:text='${waInfoMap.waname+"("+alarmMap.waCode+")" }'></span></th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<th class="text-nowrap">要素：</th>
									<td><span th:text='${alarmMap.ename+"("+alarmMap.code+")" }'></span></td>
								</tr>
								<tr>
									<th class="text-nowrap">序号：</th>
									<td><span th:text='${alarmMap.orderNum }'></span></td>
								</tr>
								<tr>
									<th class="text-nowrap">告警值：</th>
									<td><span th:text='${alarmMap.value }'></span></td>
								</tr>
								<tr>
									<th class="text-nowrap">描述：</th>
									<td><span th:text='${alarmMap.message }'></span></td>
								</tr>
								<tr>
									<th class="text-nowrap">时间：</th>
									<td class="text-muted"><span th:text='${alarmMap.time }'></span></td>
								</tr>
								<tr>
									<th class="text-nowrap">状态：</th>
									<td><span>未处理</span></td>
								</tr>
								<tr>
									<th class="text-nowrap">系统建议：</th>
									<td>
										<div th:each='o,stat:${sysHandleOptions}'
											th:utext="${o.handling_opinions}"></div>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		<div class="col-md-6">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<h5>工单信息</h5>
				</div>
				<div class="ibox-content">
					<div class="table-responsive">
						<form class="form-horizontal m" id="form-workOrder-add">
							<div class="form-group">
								<label class="col-sm-3 control-label">工单类型：</label>
								<div class="col-sm-8">
									<input name="type" type="hidden" value="1">
									告警工单
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">工单负责人：</label>
								<div class="col-sm-8">
									<input name="alarmId" type="hidden" th:value="${alarmMap._id}">
									<select name="handler">
										<option th:each='o,stat:${userList}'
											th:value="${o.login_name}" th:text="${o.user_name}"></option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label is-required">指导建议：</label>
								<div class="col-sm-8">
									<textarea name="handlingOpinions" rows="5" class="form-control" required></textarea>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<script th:inline="javascript">
		var alarmMap = [[${alarmMap}]];
		var prefix = ctx + "realtime"
		$("#form-workOrder-add").validate({
			focusCleanup : true
		});

		function submitHandler() {
			if ($.validate.form()) {
				$.operate.save(prefix + "/saveWorkOrder", $('#form-workOrder-add')
						.serialize());
			}
		}
	</script>
</body>
</html>